﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;
namespace gamexpert.member
{
    public partial class ChangeEmail : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!User.Identity.IsAuthenticated)
            {
                Response.Redirect("~/Login.aspx");
            }   
        }

        protected void btnChangeEmail_Click(object sender, EventArgs e)
        {
            MembershipUser SomeUser = Membership.GetUser(User.Identity.Name);
            SomeUser.Email = txtEmail.Text;
            Membership.UpdateUser(SomeUser);
            Response.Redirect("~/member/ChangeEmailSuccess.aspx");
        }

        protected void btnCancel_Click(object sender, EventArgs e)
        {
            Response.Redirect("~/member/MemberArea.aspx");
        }
    }
}
